//
//  UtilsMacro.h
//  ZDSC
//
//  Created by ZDTX on 2021/5/13.
//

#ifndef UtilsMacro_h
#define UtilsMacro_h


#
#define getRectNavAndStatusHight \
({\
CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];\
    CGRect rectNav = self.navigationController.navigationBar.frame;\
( rectStatus.size.height+ rectNav.size.height);\
})\

#define kScreenWidth  [UIScreen mainScreen].bounds.size.width
#define kScreenHeight  [UIScreen mainScreen].bounds.size.height

#define BTIsUserLogin  if (![BTUserLoginModel userLogin]) {\
    [[NSNotificationCenter defaultCenter] postNotificationName:BTSwitchRootViewControllerNotificationName object:nil];\
    return;\
}

#define kIs_iphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define kIs_iPhoneX kScreenWidth >=375.0f && kScreenHeight >=812.0f&& kIs_iphone
    
/*状态栏高度*/
#define kStatusBarHeight (CGFloat)(kIs_iPhoneX?(44.0):(20.0))
/*导航栏高度*/
#define kNavBarHeight (44)
/*状态栏和导航栏总高度*/
#define kNavBarAndStatusBarHeight (CGFloat)(kIs_iPhoneX?(88.0):(64.0))
/*TabBar高度*/
#define kTabBarHeight (CGFloat)(kIs_iPhoneX?(49.0 + 34.0):(49.0))
/*顶部安全区域远离高度*/
#define kTopBarSafeHeight (CGFloat)(kIs_iPhoneX?(44.0):(0))
 /*底部安全区域远离高度*/
#define kBottomSafeHeight (CGFloat)(kIs_iPhoneX?(34.0):(0))
/*iPhoneX的状态栏高度差值*/
#define kTopBarDifHeight (CGFloat)(kIs_iPhoneX?(24.0):(0))
/*导航条和Tabbar总高度*/
#define kNavAndTabHeight (kNavBarAndStatusBarHeight + kTabBarHeight)

#define safeAreaTopHeight (kIs_iPhoneX ? 88 : 64)
#define safeAreaBottomHeight (kIs_iPhoneX ? 34 : 0)

#define iPhone67inch    kScreenHeight == 926 // iPhone12Pro Max
#define iPhone61Newinch kScreenHeight == 844 // iPhone12/12Pro
#define iPhone54inch    kScreenHeight == 780 // iPhone12 min
#define iPhone65inch    kScreenHeight == 896 // iPhone11Pro MAX || iPhone XS MAX
#define iPhone61inch    kScreenHeight == 896 // iPhone11   ||iPhone XR
#define iPhone58inch    kScreenHeight == 812 // iPhone11Pro ||  iPhone XS || iPhone X
#define iPhone55inch    kScreenHeight == 736 // iPhone 8+ || iPhone 7+ || iPhone 6s+ || iPhone 6+
#define iPhone47inch    kScreenHeight == 667 // iPhone 8 || iPhone 7 || iPhone 6s || iPhone 6
#define iPhone4inch     kScreenHeight == 568 // iPhone se || iPhone 5s || iPhone 5 || iPhone 5c
#define iPhone35inch    kScreenHeight == 480 // iPhone 4s || iPhone 4


#endif /* UtilsMacro_h */
